const express = require('express');
const router = express.Router();


router.post('/login', function (req, res) {
  console.log(req.body);
  const data = req.body;
  if (data.username === "user" && data.password === "123456") {
    return res.send({ code: 200, data: 'login success!' })
  }
  return res.send({ code: -1, data: 'login failure' })
})

router.post('/register', function (req, res) {
  console.log(req.body);
  res.send('register success')
})

module.exports = router